<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <style>
    #wuzq {
      width: 600px;
      height: 600px;
    }
  </style>
</head>

<body>
  <div id="wuzq"></div>
</body>
<script src="./Board.js"></script>
<script src="./Wzq.js"></script>
<script src="./ERobot.js"></script>
<script>
  var wzq = new Wzq(wuzq);
  var rbB = new ERobot({
    m: {
      1: 200,
      2: 420,
      3: 2200,
      4: 12000
    },
    c: {
      1: 220,
      2: 420,
      3: 2200,
      4: 12000
    }
  }).connect(wzq).hold('B');

  function readStep(x, y, type) {
    wzq.readStep(x, y, type);
  }

  wzq.onsuccess = function (x, y, type) {
    console.log(type);
  }
  wzq.onclick = function(x, y) {
    console.log(x, y);
    wzq.readStep(x, y, 'H');
    rbB.drop(function (x, y, type) {
      readStep(x, y, type);
    });
  }

</script>

</html>